<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class THisdataGeneralair extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_hisdata_generalair', function (Blueprint $table) {
             $table->engine = 'MyISAM';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->increments('hd_index')->nullable(false)->comment('');
			$table->datetime('rd_updatetime')->nullable(false)->comment('');
			$table->datetime('hd_datetime')->nullable(false)->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('');
			$table->float('hd_air_innertemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_innerhum', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_backwindtemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_backwindhum', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_sendwindtemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_sendwindhum', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_ontemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_offtemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_tempdevi', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_humdevi', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_tempsetpoint', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_humsetpoint', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_tempuplim', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_humuplim', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_tempdownlim', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_humdownlim', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_state', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_windstate', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_compstate', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_runstate', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_addhotstate', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_deleshistate', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_air_addshistate', 9, 2)->nullable()->default(0)->comment('');
			$table->boolean('hd_air_temphalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_humhalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_templowalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_humlowalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_windalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_addhumalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_leakalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_poweralarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_somkealarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_origalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_online')->nullable()->default(0)->comment('');
			$table->boolean('hd_air_compalarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('hd_index', 'hd_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_hisdata_generalair');
    }
}
